<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>0323vue</title>

    <style>
        .lis{
            width: 300px;
            margin: 50px;
            float: left;
        }
    </style>

</head>
<body>
    
    
    <div id="app">
        
        <div class="lis">
            <img width="300" height="260" :src="list[0].image" alt="" srcset="">
            <div>{{list[0].name}}</div>
        </div>
        <div width="300" height="260" class="lis">
            <img :src="list[1].image" alt="" srcset="">
            <div>{{list[1].name}}</div>
        </div>
        <div width="300" height="260" class="lis">
            <img :src="list[2].image" alt="" srcset="">
            <div>{{list[2].name}}</div>
        </div>



    </div>



    <script src="https://unpkg.com/vue@3/dist/vue.global.js"></script>
    <script>

// 作业：在原有作业基础上,使用list遍历商品,每个商品初始为100个商品数量，给个input输入，输入1 对应的商品数据要 -1，如果剩余数量为0，不展示
        Vue.createApp({
            data(){
                return{
                    list:[
                       { id:0,data:100,price:100,name:"新鲜水果",image:"https://tse1-mm.cn.bing.net/th/id/OIP-C.WJ8I9XKR9CuFgMov1n65QgHaE8?w=304&h=203&c=7&r=0&o=5&pid=1.7"},
                       { id:1,data:100,price:8000,name:"iphone14",image:"https://tse3-mm.cn.bing.net/th/id/OIP-C.5-JhK658fp4WF3LTn9VOBAHaEy?w=273&h=180&c=7&r=0&o=5&pid=1.7"},
                       { id:2,data:100,price:12000,name:"五菱宏光mini",image:"https://tse2-mm.cn.bing.net/th/id/OIP-C.SJR8DPPK7fvQASUeGQMjnAHaEw?w=274&h=180&c=7&r=0&o=5&pid=1.7"}
                    ]
                }
            }
        }).mount("#app")
    </script>




</body>
</html>